package com.chenbei.erp.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.chenbei.common.domain.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Schema(description = "客户")
@TableName("erp_customer")
@Data
public class Customer extends BaseEntity {

    @Schema(description = "主键ID")
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    @Schema(description = "客户编码")
    private String code;

    @Schema(description = "姓名")
    @TableField("name")
    @NotBlank(message = "客户名称不能为空")
    private String name;

    @Schema(description = "手机号")
    @TableField("phone")
    @NotBlank(message = "手机号不能为空")
    private String phone;

    @Schema(description = "状态")
    @TableField("status")
    private Integer status;

    @Schema(description = "省份ID")
    @TableField("province_id")
    private Long provinceId;

    @Schema(description = "城市ID")
    @TableField("city_id")
    private Long cityId;

    @Schema(description = "地址")
    @TableField("address")
    private String address;

    @Schema(description = "客户代表ID")
    @TableField("customer_representative_id")
    private Long customerRepresentativeId;

    @Schema(description = "客户代表名称")
    @TableField(exist = false)
    private String customerRepresentativeName;
}
